package com.xd.server.sync.dto;

import com.xd.common.page.PaginationQuery;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 数据同步日志(DataSyncLog)传输类
 *
 * @author xiaodi
 * @since 2023-03-28 16:51:02
 */

@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "com.xd.server.sync.dto.DataSyncLogDTO", description = "数据同步日志DTO")
public class DataSyncLogDTO extends PaginationQuery {
    private static final long serialVersionUID = -32764304389377999L;
    @ApiModelProperty(value = "主键id", dataType = "String", example = "主键id")
    private String id;

    @ApiModelProperty(value = "主端ip", dataType = "String", required = true, example = "主端ip")
    @Size(message = "主端ip应小于{max}", max = 100)
    private String master;

    @ApiModelProperty(value = "备端ip", dataType = "String", required = true, example = "备端ip")
    @Size(message = "备端ip应小于{max}", max = 100)
    private String salve;

    @ApiModelProperty(value = "状态：0 失败 1成功", dataType = "Integer", required = true, example = "1")
    @DecimalMin(message = "状态：0 失败 1成功,应当大于等于于{value}", value = "0")
    @DecimalMax(message = "状态：0 失败 1成功,应当小于等于{value}", value = "1000")
    private Integer status;

    private LocalDateTime syncTime;

    @ApiModelProperty(value = "日志类型 0 cmdb数据同步 1 数据库数据同步  2 主备切换", dataType = "Integer", required = true, example = "1")
    @DecimalMin(message = "日志类型 0 cmdb数据同步 1 数据库数据同步  2 主备切换,应当大于等于于{value}", value = "0")
    @DecimalMax(message = "日志类型 0 cmdb数据同步 1 数据库数据同步  2 主备切换,应当小于等于{value}", value = "1000")
    private Integer logType;

    @ApiModelProperty(value = "0 自动  1 手动", dataType = "Integer", required = true, example = "1")
    @DecimalMin(message = "0 自动  1 手动,应当大于等于于{value}", value = "0")
    @DecimalMax(message = "0 自动  1 手动,应当小于等于{value}", value = "1000")
    private Integer type;

    @ApiModelProperty(value = "日志", dataType = "String", required = true, example = "日志")
    @Size(message = "日志应小于{max}", max = 100)
    private String syncLog;

}
